#pragma once

#include "TypeTracker.h"
#include "ObjectTracker.h"
#include "FinalizerRunLogger.h"
#include "GarbageCollectorInvoker.h"

class Controller
{
public:
	Controller(void);
	~Controller(void);

	STDMETHODIMP Initialize(CComPtr<IUnknown> pUnk);
	STDMETHODIMP Shutdown();
	STDMETHODIMP ObjectAllocated(ObjectID objectId, ClassID classId);
	STDMETHODIMP FinalizeableObjectQueued(DWORD finalizerFlags, ObjectID objectID);
	STDMETHODIMP ClassLoadFinished(ClassID classId,	HRESULT hrStatus);
	STDMETHODIMP SurvivingReferences(ULONG cSurvivingObjectIDRanges,
		ObjectID objectIDRangeStart[  ],
		ULONG cObjectIDRangeLength[  ]);

	STDMETHODIMP MovedReferences( ULONG cMovedObjectIDRanges,
		ObjectID oldObjectIDRangeStart[  ],
		ObjectID newObjectIDRangeStart[  ],
		ULONG cObjectIDRangeLength[  ]);

	STDMETHODIMP AppDomainShutdownStarted();


private:
	CComPtr<ICorProfilerInfo2> m_pCorProfilerInfo;
	TypeTracker m_TypeTracker;
	ObjectTracker m_ObjectTracker;
	FinalizerRunLogger m_FinalizerRunLogger;
	GarbageCollectorInvoker m_GCInvoker;

	std::string m_LogFilePath;
	int m_ForcedGCTimeInterval;;
};
